﻿<%@ Page Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" EnableEventValidation="false"
    CodeFile="AllInvoice.aspx.cs" Inherits="Admin_AllInvoice" Title="All Invoices List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    Check Invoice List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1"
        PersistenceMethod="Session" />
    <br />
    <data:EntityGridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AllInvoiceDataSource"
        AllowMultiColumnSorting="False" DefaultSortColumnName="VatInvoiceNumber" DefaultSortDirection="Descending"
        AllowPaging="True" ExcelExportFileName="Export_CheckInvoice.xls" AllowExportToExcel="True"
        AllowSorting="True" ExportToExcelText="Excel" PageSelectorPageSizeInterval="10"
        RecordsCount="0" ShowGridOnEmptyData="False" OnRowCommand="GridView1_RowCommand">
        <Columns>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="UpdatePaymentMode"
                        CommandArgument='<%#Bind("VatInvoiceNumber") %>' Text="Update"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Revise Payment Mode" SortExpression="PaymentModeRevised">
                <ItemTemplate>
                    <data:EntityDropDownList ID="ddl_RevisePaymentMode" runat="server" SelectedValue='<%# Bind("PaymentModeRevised") %>'
                        DataSourceID="AbAccCodeDataSource1" DataValueField="KindPment" DataTextField="KindPment"
                        AppendNullItem="True" NullItemText="" />
                    <data:AbAccountCodeDataSource runat="server" ID="AbAccCodeDataSource1" SelectMethod="GetAll">
                    </data:AbAccountCodeDataSource>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Void Type" SortExpression="VoidType">
                <ItemTemplate>
                    <data:EntityDropDownList ID="ddl_VoidType" runat="server" SelectedValue='<%# Bind("VoidType") %>'
                        DataSourceID="VoidReasonDataSource1" DataValueField="VoidDesc" DataTextField="VoidDesc"
                        AppendNullItem="True" NullItemText="" />
                    <data:VoidReasonDataSource ID="VoidReasonDataSource1" runat="server" SelectMethod="GetAll">
                    </data:VoidReasonDataSource>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Remark" SortExpression="Remark">
                <ItemTemplate>
                    <asp:TextBox runat="server" Width="150px" ID="tb_Remark" CssClass="text-input" Text='<%#Bind("Remark") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="PaymentMode" HeaderText="Payment Mode" SortExpression="PaymentMode" />
            <asp:BoundField DataField="VatInvoiceNumber" HeaderText="Vat Invoice Number" SortExpression="VatInvoiceNumber" />
            <asp:BoundField DataField="DateVisit" HeaderText="Invoice Date" SortExpression="DateVisit" />
            <asp:BoundField DataField="PatientCode" HeaderText="Patient Code" SortExpression="PatientCode" />
            <asp:BoundField DataField="PatientName" HeaderText="Patient Name" SortExpression="PatientName" />
            <asp:BoundField DataField="TotalProcedure" HeaderText="Total Procedure" SortExpression="TotalProcedure"
                DataFormatString="{0:#,##0}">
                <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="TotalPharmacy" HeaderText="Total Pharmacy" SortExpression="TotalPharmacy"
                DataFormatString="{0:#,##0}">
                <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="TotalAmountVnd" HeaderText="Total Amount Vnd" SortExpression="TotalAmountVnd"
                DataFormatString="{0:#,##0}">
                <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="TotalAmountUsd" HeaderText="Total Amount Usd" SortExpression="TotalAmountUsd"
                DataFormatString="{0:#,##0.00}">
                <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:BoundField DataField="ExchangeRate" HeaderText="Ex Rate" SortExpression="ExchangeRate"
                DataFormatString="{0:#,##0}">
                <ItemStyle HorizontalAlign="Right" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="Received" HeaderText="Received" SortExpression="Received" />
            <asp:CheckBoxField DataField="Returned" HeaderText="Returned" SortExpression="Returned" />
            <asp:BoundField DataField="ReturnedDate" HeaderText="Returned Date" SortExpression="ReturnedDate" />
        </Columns>
        <EmptyDataTemplate>
            <b>No Invoices Found!</b>
        </EmptyDataTemplate>
    </data:EntityGridView>
    <br />
    <data:AllInvoiceDataSource ID="AllInvoiceDataSource" runat="server" SelectMethod="GetPaged"
        EnablePaging="True" EnableSorting="True">
        <Parameters>
            <data:CustomParameter Name="WhereClause" Value="PaymentModeRevised=''" ConvertEmptyStringToNull="false" />
            <data:CustomParameter Name="OrderByClause" Value="ReturnedDate DESC" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex"
                Type="Int32" />
            <asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize"
                Type="Int32" />
            <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
        </Parameters>
    </data:AllInvoiceDataSource>
</asp:Content>
